Skip to content

Conversation

@kderusso
Copy link
Member

@kderusso kderusso commented Sep 23, 2025

Adds an extended section to search usage statistics, so that we can report on the usage of specific features underneath each category. The first category we will support is retrievers and specifically content supported by the text_similarity_reranker but this leaves the option open to easily add not only other retrievers but also other high level categories, or other search data.

Example output of GET _cluster/stats?human&filter_path=indices.search*:

{
  "indices": {
    "search": {
      "total": 3,
      "queries": {
        "match": 3
      },
      "rescorers": {},
      "sections": {
        "retriever": 3
      },
      "retrievers": {
        "standard": 3,
        "text_similarity_reranker": 3
      },
      "extended": {
        "retrievers": {
          "text_similarity_reranker": {
            "chunk_rescorer": 2
          }
        }
      }
    }
  }
}

@kderusso kderusso added :SearchOrg/Relevance Label for the Search (solution/org) Relevance team >enhancement labels Sep 23, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @kderusso, I've created a changelog YAML for you.

@kderusso kderusso added :Search Relevance/Search Catch all for Search Relevance >enhancement and removed >enhancement labels Sep 23, 2025
restResources {
restApi {
include '_common', 'bulk', 'indices', 'inference', 'index', 'get', 'update', 'reindex', 'search', 'field_caps', 'capabilities'
include '_common', 'bulk', 'cluster', 'indices', 'inference', 'index', 'get', 'update', 'reindex', 'search', 'field_caps', 'capabilities'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required for yaml test

@kderusso kderusso marked this pull request as ready for review September 24, 2025 17:52
@kderusso kderusso requested a review from a team September 24, 2025 17:52
@elasticsearchmachine elasticsearchmachine added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch Team:Search - Relevance The Search organization Search Relevance team labels Sep 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High level review for now. All my feedback at this time revolves around the data structure we use in ExtendedSearchUsageStats. I think we want to plan for the future here and allow for variable levels of extended stats.

@kderusso kderusso requested a review from Mikep86 September 25, 2025 15:02
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review, I'll go through the rest tomorrow. Thank you for integrating the ExtendedSearchUsageMetric interface ❤️

@kderusso kderusso requested a review from Mikep86 September 26, 2025 13:27
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left a few nit/cleanup comments, but nothing blocking.

We would need to make some changes in SearchUsage and SearchUsageHolder to use anything besides ExtendedSearchUsageLongCounter, but that's fine for now. The important thing is that the named writeable approach gives us a good way to manage serialization of future extended search usage metrics.

@kderusso kderusso enabled auto-merge (squash) September 26, 2025 17:40
@kderusso kderusso merged commit acd4068 into elastic:main Sep 26, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/Search Catch all for Search Relevance :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants